/*
 * 客户搜索
 * @Author: ljb
 * @Date: 2018-03-27 17:51:07
 * @Last Modified by: kanglin
 * @Last Modified time: 2018-06-05 09:01:30
 */
<template>
	<Form
		ref="formInline"
		inline
		@keydown.native.enter.prevent="confirmSearch">

		<Form-item
			:label-width="100"
			:label="$t('hair.asset_title')">
			<i-input
				v-model="formValidate.keywords"
				:placeholder="$t('hair.please_enter_asset_title')"
				type="text"/>
		</Form-item>

		<Form-item
			:label-width="100"
			:label="$t('hair.gender')">
			<Select
				v-model="formValidate.gender"
				clearable
				filterable
				placeholder=""
				transfer>
				<Option value="0">{{ this.$t('hair.other') }}</Option>
				<Option value="1">{{ this.$t('hair.male') }}</Option>
				<Option value="2">{{ this.$t('hair.female') }}</Option>
			</Select>
		</Form-item>

		<Form-item>
			<Button
				type="primary"
				@click="confirmSearch">
				{{ this.$t('common.search') }}
			</Button>
		</Form-item>

	</Form>
</template>
<script>

export default {

	name: 'HairSearchForm',

	data() {
		return {

			formValidate: {

				keywords: '', // 素材名称

				gender: '', // 适用人群

			}, // 搜索框的对象参数
		};
	},

	mounted() {

	},

	methods: {

		/**
         * 确认搜索
         * @return {undefined}
         */
		confirmSearch() {
			const param = {

				keywords: this.formValidate.keywords,

				gender: this.formValidate.gender,

			};

			this.$emit('search', param);
		},

	},

};

</script>
